package com.yzg.sign.project.repository;

import com.yzg.sign.project.domain.SysUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface SysUserRepository extends JpaRepository<SysUser,Integer>, JpaSpecificationExecutor<SysUser>
{


    Optional<SysUser> findByUserNameAndDeleteIsFalse(String userName);

    Optional<SysUser> findByPhoneAndDeleteIsFalse(String phone);

    Optional<SysUser> findByIdAndDeleteIsFalse(Integer id);

    Optional<SysUser> findByPhoneAndDeleteIsFalseAndAvailableIsTrue(String username);

    Optional<SysUser> findByUserNameAndDeleteIsFalseAndAvailableIsTrue(String username);
}
